package com.zzq.Model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@ApiModel("文章类")
@Data
@Accessors(chain = true)
public class Article {
    @ApiModelProperty("序号")
    private int id;
    @ApiModelProperty("用户序号")
    private int userId;
    @ApiModelProperty("标题")
    private String title;
    @ApiModelProperty("文章正文")
    private String body;
    @ApiModelProperty("创建时间")
    //设置时区为上海时区，时间格式自己据需求定。
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    private String createTime;
    @ApiModelProperty("更新时间")    //设置时区为上海时区，时间格式自己据需求定。
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    private String updateTime;
    @ApiModelProperty("被访问量")
    private int totalView;
    @ApiModelProperty("点赞数")
    private int likes;
    @ApiModelProperty("文章图")
    private String avatar;
}
